<template>
  <div>
      <section class="menu-block">
        <h2>获取购物车商品数量</h2>
        <div class="menu-block">
            <pre v-highlightA>
                <code>
import {cart} from 'fzHybrid'
...
cart.reload()
                </code>
            </pre>
            <van-button size="large" type="primary" @click="reloadClick">点击获取购物车商品数量</van-button>
        </div>
      </section>
  </div>
</template>

<script>
import {Button, Notify} from 'vant'
import {cart} from 'MTHybrid'

export default {
    data () {
        return {
        }
    },
    methods: {
        reloadClick () {
            cart.reload()
            Notify({
                message: '刷新购物车商品数量，回到主界面查看效果',
                duration: 1000,
                background: '#1989fa'
            })
        }
    },
    components: {
        [Button.name]: Button,
        [Notify.name]: Notify
    }
}
</script>

<style>
    @import '../../../static/css/index.css';
    .menu-block {
        padding: 0 0.2rem
    }
    h2 {
        margin-block-start: 0.83em;
        margin-block-end: 0.83em;
        margin-inline-start: 0px;
        margin-inline-end: 0px;
        margin: 0;
        /* font-weight: 200; */
        font-size: 18px;
        color: rgba(69,90,100,.6);
        padding: 20px 15px 15px;
    }
</style>
